<?php

/**
 * Bug form base class.
 *
 * @method Bug getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseBugForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'bug_id'                  => new sfWidgetFormInputHidden(),
      'prj_id'                  => new sfWidgetFormInputText(),
      'bug_mantis_id'           => new sfWidgetFormInputText(),
      'bug_severite'            => new sfWidgetFormInputText(),
      'bug_resolution'          => new sfWidgetFormInputText(),
      'bug_statut'              => new sfWidgetFormInputText(),
      'bug_categorie'           => new sfWidgetFormInputText(),
      'bug_resume'              => new sfWidgetFormInputText(),
      'bug_regression'          => new sfWidgetFormInputText(),
      'bug_non_corrige'         => new sfWidgetFormInputText(),
      'bug_sous_projet_libelle' => new sfWidgetFormInputText(),
      'bug_portee'              => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'bug_id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('bug_id')), 'empty_value' => $this->getObject()->get('bug_id'), 'required' => false)),
      'prj_id'                  => new sfValidatorInteger(),
      'bug_mantis_id'           => new sfValidatorInteger(),
      'bug_severite'            => new sfValidatorInteger(),
      'bug_resolution'          => new sfValidatorInteger(),
      'bug_statut'              => new sfValidatorInteger(array('required' => false)),
      'bug_categorie'           => new sfValidatorString(array('max_length' => 127, 'required' => false)),
      'bug_resume'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'bug_regression'          => new sfValidatorInteger(array('required' => false)),
      'bug_non_corrige'         => new sfValidatorInteger(array('required' => false)),
      'bug_sous_projet_libelle' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'bug_portee'              => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('bug[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Bug';
  }

}
